<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreatePatientTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreatePatientLabel_id}" for="id" />
                    <h:inputText id="id" value="#{patientController.selected.id}" title="#{bundle.CreatePatientTitle_id}" required="true" requiredMessage="#{bundle.CreatePatientRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.CreatePatientLabel_firstName}" for="firstName" />
                    <h:inputText id="firstName" value="#{patientController.selected.firstName}" title="#{bundle.CreatePatientTitle_firstName}" required="true" requiredMessage="#{bundle.CreatePatientRequiredMessage_firstName}"/>
                    <h:outputLabel value="#{bundle.CreatePatientLabel_lastName}" for="lastName" />
                    <h:inputText id="lastName" value="#{patientController.selected.lastName}" title="#{bundle.CreatePatientTitle_lastName}" required="true" requiredMessage="#{bundle.CreatePatientRequiredMessage_lastName}"/>
                    <h:outputLabel value="#{bundle.CreatePatientLabel_birthDate}" for="birthDate" />
                    <h:inputText id="birthDate" value="#{patientController.selected.birthDate}" title="#{bundle.CreatePatientTitle_birthDate}" required="true" requiredMessage="#{bundle.CreatePatientRequiredMessage_birthDate}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreatePatientLabel_personalId}" for="personalId" />
                    <h:inputText id="personalId" value="#{patientController.selected.personalId}" title="#{bundle.CreatePatientTitle_personalId}" required="true" requiredMessage="#{bundle.CreatePatientRequiredMessage_personalId}"/>
                    <h:outputLabel value="#{bundle.CreatePatientLabel_medicalNumber}" for="medicalNumber" />
                    <h:inputText id="medicalNumber" value="#{patientController.selected.medicalNumber}" title="#{bundle.CreatePatientTitle_medicalNumber}" required="true" requiredMessage="#{bundle.CreatePatientRequiredMessage_medicalNumber}"/>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{patientController.create}" value="#{bundle.CreatePatientSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{patientController.prepareList}" value="#{bundle.CreatePatientShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.CreatePatientIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
